@import "_mixins.scss";

.#{$css-prefix}btn {
  display: inline-block;
  position: relative;
  line-height: 1;
  margin: 0;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.#{$css-prefix}btn--primary {
  @include button-theme($primary-color, $primary-color, $primary-color);
}

.#{$css-prefix}btn--success {
  @include button-theme($success-color, $success-color, $success-color);
}

.#{$css-prefix}btn--info {
  @include button-theme($info-color, $info-color, $info-color);
}

.#{$css-prefix}btn--danger {
  @include button-theme($danger-color, $danger-color, $danger-color);
}

.#{$css-prefix}btn--default {
  @include button-theme($white-color, $plain-color, $plain-color);

  color: $font-primary-color;
  background: $white-color;

  &:hover {
    color: $primary-color;
    background: mix($white-color, $primary-color, 80%);
    border: 1px solid mix($white-color, $primary-color, 60%);
  }

  &.isplain {
    color: $font-primary-color;
    background: $white-color;
    border: 1px solid $plain-color;

    &:hover {
      color: $primary-color;
      background: $white-color;
      border: 1px solid mix($white-color, $primary-color, 60%);
    }

  }
  &.disabled {
    &:hover,
    &.isplain {
      color: $font-primary-color;
      background: $white-color;
      border: 1px solid $plain-color;
    }
  }
  
  &.isloading:not([class*='isplain']){
    cursor: auto;
    opacity: .6;
  }
  &.isloading:not([class*='isplain']){
    &:hover{
      color: $font-primary-color;
      background: $white-color;
    }
  }
  
  &.isloading[class*='isplain']{
    &:hover{
      color: $font-primary-color;
      background: $white-color;
      border: 1px solid $plain-color;
    }
  }
}

.#{$css-prefix}btn--text {
  @include button-theme($primary-color, $primary-color, $primary-color);
  
  padding: 0 !important;
  color: $primary-color !important;
  background: none !important;
  border: 0 !important;

  &:hover {
    color: mix($white-color, $primary-color, 20%);
  }
  &.disabled {
    color: $font-primary-color !important;
  }
}